﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="PageGridConfig.aspx.cs" Inherits="CARMS.SysPage.PageGridConfig" %>

<%@ Import Namespace="CARMSBusiness.InterFace" %>
<%@ Register Src="~/Controls/GridPager.ascx" TagName="GridPager" TagPrefix="uc1" %>
<%@ Register Src="~/Controls/ConditionControl.ascx" TagName="ConditionControl" TagPrefix="ucc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table border="0" cellpadding="5" cellspacing="0" width="100%">
        <tr>
            <td>
            <asp:Button runat="server" ID="btnRefreshColumnByDataBase" Text="Refresh Columns By Database" SkinID="Button240" OnClick="btnRefreshColumnByDataBase_Click" />
            </td>
        </tr>
       
        <tr>
            <td>
                <fieldset>
                    <legend>Data Base Column List </legend>
             
                <vs:GridView ID="gridList" runat="server" AutoGenerateColumns="False" AllowSorting="true"
                    OnRowDataBound="gridList_RowDataBound" OnRowCommand="gridList_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="Edit">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnView" runat="server" SkinID="Modify" CommandName="ModifyItem"
                                    CommandArgument='<%#Eval("GridColumnID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <vs:TemplateField HeaderText="Column Name"  >
                            <ItemTemplate>
                                <%#Eval("ColumnName")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                         <vs:TemplateField HeaderText="Header Text"  >
                            <ItemTemplate>
                                <%#Eval("HeaderText")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                        
                        <vs:TemplateField HeaderText="Column Type" >
                            <ItemTemplate>
                                <%#Eval("ColumnDataType")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                        <vs:TemplateField HeaderText="If Show in Grid">
                            <ItemTemplate>
                                <%#Eval("IfShow")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                        <vs:TemplateField HeaderText="If Can Sort" >
                            <ItemTemplate>
                                <%#Eval("IfSort")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                            <vs:TemplateField HeaderText="Sort Index" >
                            <ItemTemplate>
                                <%#Eval("SortIndex")%>
                            </ItemTemplate>
                        </vs:TemplateField>
                        <asp:TemplateField HeaderText="Create Date" SortExpression="CreateDate">
                            <ItemTemplate>
                                <%#((DateTime)Eval("CreateDate")).ToString(ApplicationConfiguration.DateFormat)%>
                            </ItemTemplate>
                        </asp:TemplateField>
                       
                    </Columns>
                </vs:GridView>
                <uc1:GridPager ID="PageQueryAdapter1" runat="server" TargetControlID="gridList" PageSize="20"
                    OnPerformGetCondition="PageQueryAdapter1_PerformGetCondition" OnPerformGetRecordCount="PageQueryAdapter1_PerformGetRecordCount"
                    OnPerformGetPageData="PageQueryAdapter1_PerformGetPageData" />
                       </fieldset>
            </td>
        </tr>
    </table>
</asp:Content>
